package java8_9;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class IsoscelesTriangle {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入等腰三角形的高度：");
        int h=in.nextInt();
        for(int i=1;i<=h;i++){
            //空格几个*
            for(int k=1;k<=h-i;k++)
                System.out.print(" ");
            for(int j=1;j<=2*i-1;j++){
                //边缘打*，其他空格
                if(i==1||i==h||j==1||j==2*i-1)
                    System.out.print("*");
                else
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
}
